<template>
	<view>
		<view class="an-notice-box">
			<scroll-view class="an-notice-content" >
				<swiper class="swiper" :autoplay="true" :interval="switchTime*2000" :duration="1500" :circular="true" :vertical="true">
					<swiper-item v-for="(item, index) in msg" :key="index" class="an-notice-content-item">
						<view class="swiper-item">
							<view class="an-notice-content-item-text">
								<image class="headImage" :src="item.headImage" mode=""></image>
								<view class="noticeName overflow_one">{{item.title}}</view>
							</view>
						</view>
					</swiper-item>
				</swiper>
			</scroll-view>
		</view>
	</view>
</template>
<style>
	.headImage{width:48upx;height:48upx;float: left;margin-top: 6upx;border-radius: 100upx;}
	.noticeName{width:80%;float: left;margin-left: 5%;color:white}
</style>
<script>
	import uniIcons from '@/components/uni-icons/uni-icons.vue'
	export default {
		components: {
			uniIcons
		},
		props:{
			msg:{
				type:Array,
				default: '暂无未读消息'
			},
			switchTime: {
				type: Number,
				default: 3
			},
		},
		data() {
			return {
				number: 0,
			};
		},
		mounted(){},
		methods: {			
			
		}
	}
</script>

<style>
	.swiper{
		height: 60upx!important;
	}
	.an-notice-box{
		width: 100%; 
		height: 60upx; 
		padding: 0 10upx; 
		overflow: hidden; 
		/* margin: 20upx 0; */
		display: flex; 
		justify-content: flex-start;
	}
	.an-notice-icon{
		width: 60upx; 
		height: 60upx; 
		line-height: 50upx; 
		text-align: center; 
		position: relative;
		left:5%;
	}
	.an-notice-content{
		/* width: calc(100% - 220upx); */
		width:100%;
		/* margin-left: 5%; */
		height: 60upx;
		position: relative; 
		font-size: 14px;
	}
	.an-notice-content-item{
		width: 100%; 
		height: 60upx; 
		text-align: left; 
		line-height: 60upx;
	}
	.an-notice-content-item-text{
		width: 100%;
		height:40px;
		/* line-height: 20px;
		display: block; 
		white-space: nowrap; 
		text-overflow: ellipsis; 
		overflow: hidden; */
	}
	.an-notice-more{
		width: 25%;
		margin-right: 5%;
		float: left;
		height: 42upx; 
		font-size: 12px; 
		line-height: 42upx; 
		text-align: right; 
		color: #999;
	}
	.swiper-item{width:100%;float: left;}
	
	@keyframes anotice {
		 0%  {transform: translateY(100%);}
	    30%  {transform: translateY(0);}
	    70%  {transform: translateY(0);}
	   100%  {transform: translateY(-100%);}
	}
</style>
